﻿using System;
using System.Threading;

class Clock
{
    public event Action Tick;
    public event Action Alarm;

    public void Start(int tickCount, int alarmTime)
    {
        for (int i = 1; i <= tickCount; i++)
        {
            Tick?.Invoke();
            Console.WriteLine($"Tick: 第{i}秒");
            Thread.Sleep(1000); 

            if (i == alarmTime)
                Alarm?.Invoke();
        }
    }
}

class Program
{
    static void Main()
    {
        Clock clock = new Clock();
        clock.Tick += () => Console.WriteLine("嘀嗒...");
        clock.Alarm += () => Console.WriteLine("闹钟响了！！！");

        clock.Start(10, 5);
    }
}
